﻿using System;
using System.Collections.Generic;
using System.Text;

namespace I_C
{
    abstract class I2CDevice
    {
        public enum OPERATION
        {
            START,
            RESTART,
            STOP,
            SEND,
            SEND_ADDRESS,
            RECEIVE,
            ACK,
            NACK,
            ANY
        }
        // ========== I2C Address
        protected byte address;

        // ========== Is this device controlling the data line?
        bool isControllingSDA;   
        public bool IsControllingSDA
        {
            get
            {
                return isControllingSDA;
            }
            set
            {
                isControllingSDA = value;
            }
        }

        // ========== Update
        public abstract bool Update(OPERATION operation, byte data);
    }
}
